package com.smarttest.main

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import com.smarttest.R
import com.smarttest.base.BaseActivity
import io.reactivex.schedulers.Schedulers
import org.jetbrains.anko.AnkoLogger
import org.jetbrains.anko.error
import javax.inject.Inject

class MainActivity : BaseActivity(), AnkoLogger {

    @Inject
    lateinit var viewModel: MainViewModel


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(getContentId())
        viewModel.login().subscribeOn(Schedulers.io()).subscribe({
            val data=it.string()
            error { "data::::$data" }
        }, {
            it.printStackTrace()
        })
    }

    override fun getContentId(): Int = R.layout.activity_main

    override fun responseWifiReceiver(code: Int) {
        error { "code::::$code" }
    }

}
